package main;

import operatori.Cat;
import operatori.Minus;
import operatori.OpXX;
import operatori.Plus;
import operatori.Produs;
import functii.Constanta;
import functii.Exp;
import functii.Log;
import functii.Necunoscuta;
import functii.Putere;
import functii.Radical;
import functii.Arccos;
import functii.Arcctg;
import functii.Arcsin;
import functii.Arctg;
import functii.Cos;
import functii.CosH;
import functii.Ctg;
import functii.Sin;
import functii.SinH;
import functii.Tg;
import arbore.ArboreFunctional;
import arbore.Nod;

public class Main {
	public static void main(String[] args) {
		
		//plus
		Nod n1 = new Necunoscuta();
		Nod c1 = new Constanta(3);
		Nod p1 = new Plus();
		p1.setfStang(n1);
		p1.setfDrept(c1);    
		ArboreFunctional a1 = new ArboreFunctional(p1); 
		System.out.println("PLUS");
		System.out.println("f(x) = " + a1);
		System.out.println("f'(x) = " + a1.derivata());
		System.out.println("f(5) = " + a1.calculezValoare(5));
		System.out.println("f'(6) = "+ a1.calculezDerivata(6));
		System.out.println();
		
		//minus
		Nod n2 = new Necunoscuta();
		Nod c2 = new Constanta(3);
		Nod p2 = new Minus();
		p2.setfStang(n2);
		p2.setfDrept(c2);    
		ArboreFunctional a2 = new ArboreFunctional(p2); 
		System.out.println("MINUS");
		System.out.println("f(x) = " + a2);
		System.out.println("f'(x) = " + a2.derivata());
		System.out.println("f(5) = " + a2.calculezValoare(5));
		System.out.println("f'(6) = "+ a2.calculezDerivata(6));
		System.out.println();
		
		//produs
		Nod n3 = new Necunoscuta();
		Nod c3 = new Constanta(4);	
		Nod p3 = new Produs();	
		p3.setfStang(c3);
		p3.setfDrept(n3);			
		ArboreFunctional a3 = new ArboreFunctional(p3);	
		System.out.println("PRODUS");
		System.out.println("f(x) = " + a3);
		System.out.println("f'(x) = " + a3.derivata());
		System.out.println("f(2) = " + a3.calculezValoare(2));
		System.out.println("f'(3) = " + a3.calculezDerivata(3));
		System.out.println();
		
		//cat
		Nod n4 = new Necunoscuta();
		Nod c4 = new Constanta(5);	
		Nod p4 = new Cat();	
		p4.setfStang(c4);
		p4.setfDrept(n4);			
		ArboreFunctional a4 = new ArboreFunctional(p4);	
		System.out.println("CAT");
		System.out.println("f(x) = " + a4);
		System.out.println("f'(x) = " + a4.derivata());
		System.out.println("f(2) = " + a4.calculezValoare(2));
		System.out.println("f'(3) = " + a4.calculezDerivata(3));
		System.out.println();
		
		//op**
		Nod n5 = new Necunoscuta();
		Nod c5 = new Constanta(5);	
		Nod p5 = new OpXX();	
		p5.setfStang(c5);
		p5.setfDrept(n5);			
		ArboreFunctional a5 = new ArboreFunctional(p5);
		System.out.println("OP**");
		System.out.println("f(x) = " + a5);
		System.out.println("f'(x) = " + a5.derivata());
		System.out.println("f(2) = " + a5.calculezValoare(2));
		System.out.println("f'(3) = " + a5.calculezDerivata(3));
		System.out.println();
		

		//sin
		Nod n6 = new Necunoscuta();
		Nod c6 = new Sin();
		c6.setfStang(n6);			
		ArboreFunctional a6 = new ArboreFunctional(c6);	
		System.out.println("SIN");
		System.out.println("f(x) = " + a6);
		System.out.println("f'(x) = " + a6.derivata());
		System.out.println("f(0.5) = " + a6.calculezValoare(0.5));
		System.out.println("f'(1) = " + a6.calculezDerivata(1));
		System.out.println();

		//cos
		Nod n7 = new Necunoscuta();
		Nod c7 = new Cos();
		c7.setfStang(n7);			
		ArboreFunctional a7 = new ArboreFunctional(c7);	
		System.out.println("COS");
		System.out.println("f(x) = " + a7);
		System.out.println("f'(x) = " + a7.derivata());
		System.out.println("f(0.25) = " + a7.calculezValoare(0.25));
		System.out.println("f'(1) = " + a7.calculezDerivata(1));
		System.out.println();
		
		//tg
		Nod n8 = new Necunoscuta();
		Nod c8 = new Tg();
		c8.setfStang(n8);			
		ArboreFunctional a8 = new ArboreFunctional(c8);	
		System.out.println("TG");
		System.out.println("f(x) = " + a8);
		System.out.println("f'(x) = " + a8.derivata());
		System.out.println("f(0.5) = " + a8.calculezValoare(0.5));
		System.out.println("f'(1) = "+a8.calculezDerivata(1));
		System.out.println();
		
		//ctg
		Nod n9 = new Necunoscuta();
		Nod c9 = new Ctg();
		c9.setfStang(n9);			
		ArboreFunctional a9 = new ArboreFunctional(c9);	
		System.out.println("CTG");
		System.out.println("f(x) = " + a9);
		System.out.println("f'(x) = " + a9.derivata());
		System.out.println("f(0.5) = " + a9.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a9.calculezDerivata(1));
		System.out.println();
		
		//arcsin
		Nod n10 = new Necunoscuta();
		Nod c10 = new Arcsin();
		c10.setfStang(n10);			
		ArboreFunctional a10 = new ArboreFunctional(c10);	
		System.out.println("ARCSIN");
		System.out.println("f(x) = " + a10);
		System.out.println("f'(x) = " + a10.derivata());
		System.out.println("f(0.5) = " + a10.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a10.calculezDerivata(1));
		System.out.println();
		
		//arccos
		Nod n11 = new Necunoscuta();
		Nod c11 = new Arccos();
		c11.setfStang(n11);			
		ArboreFunctional a11 = new ArboreFunctional(c11);	
		System.out.println("ARCCOS");
		System.out.println("f(x) = " + a11);
		System.out.println("f'(x) = " + a11.derivata());
		System.out.println("f(0.5) = " + a11.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a11.calculezDerivata(1));
		System.out.println();
		
		//arctg
		Nod n12 = new Necunoscuta();
		Nod c12 = new Arctg();
		c12.setfStang(n12);			
		ArboreFunctional a12 = new ArboreFunctional(c12);	
		System.out.println("ARCTG");
		System.out.println("f(x) = " + a12);
		System.out.println("f'(x) = " + a12.derivata());
		System.out.println("f(0.5) = " + a12.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a12.calculezDerivata(1));
		System.out.println();
		
		//arcctg
		Nod n13 = new Necunoscuta();
		Nod c13 = new Arcctg();
		c13.setfStang(n13);			
		ArboreFunctional a13 = new ArboreFunctional(c13);	
		System.out.println("ARCCTG");
		System.out.println("f(x) = " + a13);
		System.out.println("f'(x) = " + a13.derivata());
		System.out.println("f(0.5) = " + a13.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a13.calculezDerivata(1));
		System.out.println();
		
		//sinH
		Nod n14 = new Necunoscuta();
		Nod c14 = new SinH();
		c14.setfStang(n14);			
		ArboreFunctional a14 = new ArboreFunctional(c14);	
		System.out.println("SINh");
		System.out.println("f(x) = " + a14);
		System.out.println("f'(x) = " + a14.derivata());
		System.out.println("f(0.5) = " + a14.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a14.calculezDerivata(1));
		System.out.println();
		
		//cosH
		Nod n15 = new Necunoscuta();
		Nod c15 = new CosH();
		c15.setfStang(n15);			
		ArboreFunctional a15 = new ArboreFunctional(c15);	
		System.out.println("COSh");
		System.out.println("f(x) = " + a15);
		System.out.println("f'(x) = " + a15.derivata());
		System.out.println("f(0.5) = " + a15.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a15.calculezDerivata(1));
		System.out.println();
		
		//exponent
		Nod n16 = new Necunoscuta();
		Nod c16 = new Exp();
		c16.setfStang(n16);			
		ArboreFunctional a16 = new ArboreFunctional(c16);	
		System.out.println("EXPONENT");
		System.out.println("f(x) = " + a16);
		System.out.println("f'(x) = " + a16.derivata());
		System.out.println("f(0.5) = " + a16.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a16.calculezDerivata(1));
		System.out.println();
		
		//logaritm
		Nod n17 = new Necunoscuta();
		Nod c17 = new Log();
		c17.setfStang(n17);			
		ArboreFunctional a17 = new ArboreFunctional(c17);	
		System.out.println("LOGARITM");
		System.out.println("f(x) = " + a17);
		System.out.println("f'(x) = " + a17.derivata());
		System.out.println("f(0.5) = " + a17.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a17.calculezDerivata(1));
		System.out.println();
		
		//putere
		Nod n18 = new Necunoscuta();
		Nod c18 = new Putere();
		c18.setfStang(n18);			
		ArboreFunctional a18 = new ArboreFunctional(c18);	
		System.out.println("PUTERE");
		System.out.println("f(x) = " + a18);
		System.out.println("f'(x) = " + a18.derivata());
		System.out.println("f(0.5) = " + a18.calculezValoare(0.5));
		System.out.println("f'(1) = "+ a18.calculezDerivata(1));
		System.out.println();
		
		//radical
		Nod n19 = new Necunoscuta();
		Nod c19 = new Radical();
		c19.setfStang(n19);			
		ArboreFunctional a19 = new ArboreFunctional(c19);	
		System.out.println("RADICAL");
		System.out.println("f(x) = " + a19);
		System.out.println("f'(x) = " + a19.derivata());
		System.out.println("f(16) = " + a19.calculezValoare(16));
		System.out.println("f'(1) = "+ a19.calculezDerivata(1));
		System.out.println();
	}
}